package com.blog.common.exception;


import com.blog.common.constant.ResultCode;

/**
 * 统一异常处理
 */
public class BlogException extends RuntimeException {
    private final Integer code;
    private final String msg;

    public BlogException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BlogException(ResultCode exceptionEnum) {
        this(exceptionEnum.code(), exceptionEnum.message());
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
